<div class="headerMain">
	<div class="logo" onclick="window.location.href='/ceca_two/modules/index/index.html'"><img src="/ceca_two/img/logo.png"></div>
	<div class="nav">
		<ul class="navMain">
			<li>
				<a class="notopen" href="/ceca_two/modules/index/index.html">首页</a>
			</li>
			<li class="ZJ">
				<a href="/ceca_two/modules/policy/policyList.html">法规库</a>
				<ul class="ZJT" id="zjt"></ul>
			</li>
			<li class="WPM">
				<a href="/ceca_two/modules/guidance/governmentInformation.html">信息价</a>
			</li>
			<li>
				<a class="notopen" href="/ceca_two/modules/market/bazaarInformation.html">市场价</a>
			</li>
			<li>
				<a class="notopen" href="/ceca_two/modules/costnorm/construction.html">指标共享</a>
			</li>
			<!--<li>
				<a href="javascript:;">合同管理</a>
			</li>-->
			<li>
				<a class="notopen" href="/ceca_two/modules/software/software.html">应用软件</a>
			</li>
			<!--<li>
				<a href="/ceca_two/modules/onlineClass/onlineClass.html">在线课堂</a>
			</li>-->
		</ul>

	</div>
	<p class="location" style="line-height: 0;">
		<i class="locationMain" style="line-height: 60px;"></i>
		<img src="/ceca_two/img/location.png" style="position: relative;top: 22px;">
	</p>
	<div id="nologin">
		<a class="login" href="/user/modules/login/login.html">登录</a>
		<a class="register" href="/user/modules/login/register.html">注册</a>
	</div>
	<div id="islogin">
		<a href="/user/modules/index/index.html" class="userName" id="name"><img src="/ceca_two/img/center.png" />个人中心</a>
		<a class="out" onclick="logout()">退出</a>
	</div>
</div>
<script>
	function logout() {
		$.ajax({
			type: "post",
			url: "/guidance_service/front/user/logout.do",
			async: true,
			success: function() {
				$.cookie('userId', null, {
					path: "/",
					expires: -1
				});
				$.cookie('userName', null, {
					path: "/",
					expires: -1
				});
				window.location.reload();
			}
		});
	}
	layui.use(['Index', 'share', "layer"], function() {
		function getCookie(name) {
			var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
			if(arr = document.cookie.match(reg)) {
				return unescape(arr[2]);
			} else {
				return null;
			}
		}
		//	document.getElementById("name").innerHTML=getCookie("user");
		if(getCookie("userName") && getCookie("userName") != "") {
			$("#nologin").hide();
			$("#islogin").show();
		}

	});
	layui.use(['header', 'Router', 'laytpl'], function() {
		var field = sessionStorage.getItem("field");
		if(field == null | field == "null") {
			var Router = layui.Router;
			var laytpl = layui.laytpl;
			var FieldUrl = Router.link.costnorm.getField;
			$.post(FieldUrl, {}, function(result) {
				var data = result.data;
				sessionStorage.setItem("field", JSON.stringify(data));
				reptainHeader(data);
			});
		} else {
			reptainHeader(jQuery.parseJSON(field));
		}

		function reptainHeader(data) {
			$.each(data, function(index, d) {
				if(d.fieldParantId == 1) $("#zjt").append("<li><a  href=/ceca_two/modules/policy/policyList.html?fieldId=" + d.fieldId + ">" + d.fieldName + "</a></li>");
			});
		}
	});
</script>
<script type="text/javascript">
	$(function() {
		$(".notopen").click(function() {
			var href = window.location.href;
			if(href.indexOf("test") > 0) {
				layer.msg("尚未开启公测", {
					icon: 2,
					time: 5000
				});
				return false;
			}

		})
	})
</script>